package com.qingcloud.base.api.remote.uaa;

import com.qingcloud.base.api.remote.uaa.factory.UaaApiFallbackFactory;
import com.qingcloud.base.constant.AppNameConstant;
import com.qingcloud.base.pojo.Result;
import com.qingcloud.base.remote.uaa.Client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(contextId = "uaaApi", value = AppNameConstant.UAA_CENTOR, fallbackFactory = UaaApiFallbackFactory.class)
public interface UaaApi {

    @GetMapping("clients/getClients/{id}")
    Client getClients(@PathVariable("id") Long id);


    @GetMapping("clients/getClientByClientId/{clientId}")
    Client getClientByClientId(@PathVariable("clientId") String clientId);

    @GetMapping("clients/deleteClient")
    void deleteClient(@RequestParam("ids") String ids);
    /**
     * @param client
     */
    @PostMapping("clients/saveOrUpdate")
    Result<Client> saveOrUpdate(@RequestBody Client client);

    @GetMapping("clients/getClientIdByAccessToken")
    Result<String> getClientIdByAccessToken(@RequestParam("accessTokenValue") String accessTokenValue);

}
